#pragma once

#include <mutex>
#include <memory>

#include "DisplayBase.h"
#include "Image.h"

using namespace std;

class CImageDisplay : public CDisplayBase
{
public:
	CImageDisplay();

	virtual ~CImageDisplay();

public:
	void ShowImage(CImage * pImage);

protected:
	virtual void Display(HDC hDc);

private:
	void CaleShowRect(RECT * pRect);

private:
	bool                        m_BmpValid;

	shared_ptr<unsigned char>   m_BmpDataBuffer;

	unsigned long               m_BmpDataBufferLong;

	int                         m_BmpBitCountPerPixel;

	int                         m_BmpWidth;

	int                         m_BmpHeight;

	mutex                       m_BmpDataLock;
};